package com.cy.pj.sys.controller;

import com.cy.pj.common.pojo.JsonResult;
import com.cy.pj.common.pojo.PageObject;
import com.cy.pj.sys.pojo.SysLog;
import com.cy.pj.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    //@RequestMapping(value="/log/doDeleteObjects/{ids}",method = RequestMethod.DELETE)
    @DeleteMapping("/log/doDeleteObjects/{ids}")//rest
    public JsonResult doDeleteObjects(@PathVariable Integer... ids){
        sysLogService.deleteObjects(ids);
        return new JsonResult("delete ok");
    }


    @GetMapping("/log/doFindPageObjects")
    public JsonResult doFindPageObjects(String username, Integer pageCurrent){
           PageObject<SysLog> pageObject= sysLogService.findPageObjects(username, pageCurrent);
           return new JsonResult(pageObject);//封装的是正确的响应结果
    }

}
